﻿using System;

namespace FabunaqiiSequence
{
    class Program
    {
        static int NewRabbitOfMonth(int n)
        {
            if (n == 1)
            {
                return 1;
            }
            else if (n == 2)
            {
                return 0;
            }
            else
            {
                return NewRabbitOfMonth(n - 1) + NewRabbitOfMonth(n - 2);
            }
        }
        static void Main(string[] args)
        {
            Console.Write("请输入第几个月：");
            int n = int.Parse(Console.ReadLine());
            int sumRabbitOfMonth = 0;
            for (int i = 1; i <= n; i++)
            {
                sumRabbitOfMonth += NewRabbitOfMonth(i);
            }
            Console.Write("第" + n + "个月共有" + sumRabbitOfMonth + "对兔子");
            Console.ReadLine();
        }
    }
}
